<template>
    <el-input v-bind="$attrs" v-on="$listeners" type="textarea"></el-input>
</template>

<script>
export default {
    watch: {
        '$attrs.value'() {
            this.$nextTick(t => {
                var el = this.$el
                if (el) {
                    var tx = el.querySelector('textarea')
                    tx.style.height = '10px'
                    tx.style.height = tx.scrollHeight + tx.offsetHeight - tx.clientHeight + 'px'
                }
            })
        }
    }
}
</script>
